<template>
    <div class="task-info">
        <el-form class="task-info-form" @submit.native.prevent>
            <el-form-item class="exp-form-item" label="任务名称"><span class="desc-tip">{{data.scheduleName}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="所属项目"><span class="desc-tip">{{currentProjectInfo.projectName}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="调度状态"><span class="desc-tip">{{data.status?'已调度':'未调度'}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="实验ID"><span class="desc-tip">{{data.experimentId}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="调度周期"><span class="desc-tip">{{periodTypes[data.periodType]}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="调度时刻"><span class="desc-tip">{{data.schedulTimeStr}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="修改人"><span class="desc-tip">{{data.lastUpdateOper}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="最近修改时间"><span class="desc-tip">{{data.lastUpdateTime}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="创建人"><span class="desc-tip">{{data.createOper}}</span></el-form-item>
            <el-form-item class="exp-form-item" label="创建日期"><span class="desc-tip">{{data.createTime}}</span></el-form-item>
        </el-form>
    </div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
    name: 'TaskInfo',
    props: {
        data: {
            type: Object,
            default: () => {
                return {
                    scheduleName: '',
                    status: '',
                    periodType: '',
                    lastUpdateOper: '',
                    lastUpdateTime: '',
                    createOper: '',
                    createTime: ''
                }
            }
        }
    },
    computed: {
        ...mapGetters({
            currentProjectInfo: 'common/getCurrentProjectInfo'
        })
    },
    data () {
        return {
            periodTypes: ['秒', '分钟', '小时', '天', '周', '月', '年']
        }
    }
}
</script>
<style lang="less">
    .task-info {
        padding: 0 10px;
        .desc-tip {
            padding-left: 10px;
            font-size: 13px;
        }
        .exp-form-item {
            display: flex;
            white-space: nowrap;
            margin-bottom: 0;
        }
    }
</style>
